import 'dart:io';
import 'dart:isolate';

/// CreateTime 2020/7/8 18:28
/// CreateUser chen 
/// ProjectName flutter_elf
import 'package:flutter_elf/config/component_index.dart';

import 'download/file_utils.dart';

//void main()async{
//  String inputPath = 'E:/ts视频/';
//  String outputPath = 'E:/ts视频/';
//  Directory d = Directory(inputPath);
//  List<FileSystemEntity> files = d.listSync();
//  print(files[0].path);
//  print(files[1].path);
////  File f1 = File(files[0].path);
////  File f2 = File(files[1].path);
//  File newFile = await FileUtils.createFile(outputPath + '输出.ts');
//  newFile.writeAsBytesSync(File(files[0].path).readAsBytesSync(),mode: FileMode.append);
//  newFile.writeAsBytesSync(File(files[1].path).readAsBytesSync(),mode: FileMode.append);
//  await Future.delayed(Duration(seconds: 1000000));
//
//}

int threadCount = 3;
String inputPath = 'E:/ts视频/';
String outputPath = 'E:/ts视频/output/';
ReceivePort rcvPort = ReceivePort();
void main()async{
  rcvPort.listen((data){

  });
  Directory d = Directory(inputPath);
  List<FileSystemEntity> files = d.listSync();


  await Future.delayed(Duration(seconds: 3));
  startThread(files);
  await Future.delayed(Duration(seconds: 1000000));
}
//开启多线程
startThread(List<FileSystemEntity> files)async{
  await Future.delayed(Duration(seconds: 1));
  Isolate iso = await Isolate.spawn(port, rcvPort.sendPort);


}

port(SendPort sendPort){
  sendPort.send('1232');
}

